package net.paoding.rose.web.impl.view;

import java.util.HashMap;

import javax.servlet.ServletContext;

import net.paoding.rose.RoseConstants;

/**
 * 
 * @author zhiliang.wang [qieqie.wang@paoding.net]
 * 
 */
public class ViewPathCache {

	@SuppressWarnings("unused")
	private ServletContext servletContext;
	private String modulePath;

	private HashMap<String, String> viewPathMap = new HashMap<String, String>();

	public ViewPathCache(ServletContext servletContext, String modulePath) {
		this.servletContext = servletContext;
		this.modulePath = modulePath;
	}

	public String getViewPath(String viewName) {
		return viewPathMap.get(viewName);
	}

	public void setViewPath(String viewName, String viewPath) {
		viewPathMap.put(viewName, viewPath);
	}

	public String getDirectoryPath() {
		return RoseConstants.VIEWS_PATH + modulePath;
	}

}
